# Created by: Koop Mast <kwm@FreeBSD.org>
# $FreeBSD: ports/multimedia/pitivi/Makefile,v 1.24 2012/06/01 05:22:40 dinoex Exp $
#

PORTNAME=	pitivi
PORTVERSION=	0.15.2
CATEGORIES=	multimedia
MASTER_SITES=	GNOME

MAINTAINER=	kwm@FreeBSD.org
COMMENT=	Gstreamer based non-linear audio/video editor

RUN_DEPENDS=	py*-zope.interface>=0:${PORTSDIR}/devel/py-zope.interface \
		${PYTHON_SITELIBDIR}/goocanvasmodule.so:${PORTSDIR}/graphics/py-goocanvas \
		${PYTHON_SITELIBDIR}/xdg/__init__.py:${PORTSDIR}/devel/py-xdg

USE_XZ=	yes
USE_GMAKE=	yes
USE_GNOME=	pygtk2 gnomedocutils desktopfileutils
USE_GSTREAMER=	gnonlin python good
USE_PYTHON=	2.7
INSTALLS_ICONS=	yes
GNU_CONFIGURE=	yes
USE_PKGCONFIG=	build
USE_GETTEXT=	yes
CPPFLAGS+=	-I${LOCALBAES}/include
LDFLAGS+=	-L${LOCALBASE}/lib
CONFIGURE_ARGS=	--localstatedir=/var --without-help-dir

OPTIONS_DEFINE=	FFMPEG FREI0R NUMPY
OPTIONS_DEFAULT=	FREI0R

# Override FFmpeg description
FFMPEG_DESC=	FFmpeg (Gstreamer) plugin
FREI0R_DESC=	Video effects support

MAN1=	pitivi.1

PLIST_SUB=	VERSION="${PORTVERSION}"

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MFFMPEG}
USE_GSTREAMER+=	ffmpeg
.endif

.if ${PORT_OPTIONS:MFREI0R}
# scaleOtilt filter
RUN_DEPENDS+=	frei0r-plugins-gavl>=1.3:${PORTSDIR}/graphics/frei0r-plugins-gavl
.endif

.if ${PORT_OPTIONS:MNUMPY}
RUN_DEPENDS+=	${PYTHON_SITELIBDIR}/numpy:${PORTSDIR}/math/py-numpy
.endif

post-patch:
	@${FIND} ${WRKSRC} -name 'Makefile.in' -type f \
		| ${XARGS} ${REINPLACE_CMD} -e \
		's|(libdir)/pitivi/python/pitivi|(libdir)/${PORTNAME}-${PORTVERSION}/pitivi|'

post-install:
	@-update-desktop-database

.include <bsd.port.mk>
